pipeline {
    //agent { label 'slave_agent' }
    agent any
    stages {
        stage('拉取代码') {
            steps {
                checkout([$class: 'GitSCM', branches: [[name: 'release']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'b7b8c625-e70d-4e73-b6c3-a1c96653078e', url: 'http://10.248.63.130/atap/frontend.git']]])
            }
        }
        
       	stage('安装依赖') {
            steps {
            	echo '安装依赖'
                //sh 'npm install'
            }
        }
       	
        stage('构建打包') {
            steps {
            	echo '构建打包'
                //sh 'npm run build'
            }
        }
        
        stage('推送部署文件') {
            steps {
                script {
                    sh "cd ${WORKSPACE} && tar -zvcf dist.tar.gz dist && tar -zvcf docker.tar.gz docker"
                    sh "scp ${WORKSPACE}/dist.tar.gz atapfronted@10.248.67.193:/home/atapfronted"
                    //sh "scp ${WORKSPACE}/docker.tar.gz atapfronted@10.248.67.193:/home/atapfrontend"
                    //sh "ssh atapfronted@10.248.67.193 /home/atapfrontend/startfrontend.sh"
                }
            }
        }
    }
}